import re

import requests
url="https://miniwebtool.com/zh-cn/hex-calculator/?"
print("请输入要计算的参数")
number1=(input("number1:"))
number2=(input("number2:"))
print("输入运算符号:+ - * /")
operates=(input("符号:"))
if operates=='+':
    operate=1
if operates=='-':
    operate=2
if operates=='*':
    operate=3
if operates=='/':
    operate=4
url_param="number1={}&operate={}&number2={}".format(number1,operate,number2)
url=url+url_param
headers={'user-agent': 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; hu-hu) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10'}
response=requests.get(url,headers)
data=response.text
result=re.findall("<br>\s<span\sclass=nt>(.*?)</span>\s</div><div\sclass=r1>(.*?)</div>",data)
#print(result)
print(result[0][0],"\n结果为:",result[0][1])